﻿using ConsoleApp.Valid.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp.Valid
{
    public class test
    {
       public static void testmain()
        {
            var person = new Person { Name = "张三", Age = 15 };
            string errorMessage;
            bool isValid = Validator.Validate(person, out errorMessage);
            if (!isValid)
            {
                Console.WriteLine(errorMessage); // 输出：该字段是必填项。
            }
            Console.ReadLine();
        }
    }
}
